<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      /*


        */
      class Person {
        constructor(name, age) {
          this.name = name;
          this.age = age;
        }
      }
      const ArrPerson = [new Person('GG', 18), new Person('GG', 38), new Person('GG', 8)];
      function filter(arr) {

        const newArr = [];

        for (let i = 0; i < arr.length; i++) {
          if (arr[i].age < 18) {
            newArr.push(arr[i]);
          }
        }
        return newArr
      }
      const result = filter(ArrPerson);
      console.log(result);
    </script>
  </head>
  <body></body>
</html>
